package com.booby.javabase.enums;

/**
 * 功能描述: 应用类型
 *
 * @author: lizt
 * @date: 2019-06-30 09:01
 **/

public enum AppType {
    /*
     * 应用枚举类型
     */
    ANDROID(1, "安卓"),
    IOS(2, "IOS"),
    H5(3, "H5");

    AppType(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getValue(int key){
        if (0 > key){
            return null;
        }
        for (AppType item : AppType.values()){
            if (item.getKey() == key){
                return item.getValue(key);
            }
        }
        return null;
    }

    private int key;
    private String value;

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

}
